{%- if recent_posts -%}
<div class="col-lg-3 visible-lg sidebar">
    <h2>Recent articles</h2>
    <hr>
    <ul>
    {% for post in recent_posts %}
        <li><a href="{{ url_for('single_post', permalink=post['permalink']) }}">{{ post['title'] | safe }}</a></li>
    {% endfor %}
    </ul>
    {%- if tags -%}
    <h2>Top tags</h2>
    <hr>
    <ul>
    {% for tag in tags %}
        <li><a href="{{ url_for('posts_by_tag', page=1, tag=tag['title']) }}">{{ tag['title'] }} <sup class="badge">{{ tag['count'] }}</sup></a></li>
    {% endfor %}
    </ul>
    {%- endif -%}
</div>
{%- endif -%}
